import React, {Component} from "react";
import {inject, observer} from "mobx-react";
import QueryItem from "../QueryItem";
import {Link} from "react-router-dom";

@inject("queryStore")
@observer
class QuerySuccess extends Component {
    constructor(props) {
        super(props);
        this.handleClick = this.handleClick.bind(this);
    }

    handleClick() {
        // this.props.queryStore.setAccurateQuery(false);
        this.props.queryStore.setFlag(-1);
    }

    render() {
        const {results} = this.props;
        return (
            <div>
                <div>
                    您查询的结果如下：
                </div>
                <div >
                    {results.map(item => (<QueryItem fellow={item}/>))}
                </div>
                <Link to='/queryAlumnu'>
                    <button onClick={this.handleClick}>返回查询校友主界面</button>
                </Link>
            </div>

        )
    }
}

export default QuerySuccess;